//获取随机数
function getNum(min, max = 0) {
    min < max ? '' : [min, max] = [max, min];
    return parseInt(Math.random() * (max - min + 1)) + min;
}

//获取标签样式
function getNodeStyle(node, temp = null) {
    if (node.currentStyle) {
        return node.currentStyle;
    } else {
        return window.getComputedStyle(node, temp);
    }
}

//获取时间
function getTime() {
    let day = new Date();
    let yue = day.getMonth() + 1;
    yue < 10 ? yue = "0" + yue : "";
    let time = day.getFullYear() + "-" + yue + "-" + day.getDate() + " " + day.toTimeString().slice(0, 8);
    return time; //例如 2021-01-12 16:29:21
}

//视频全屏
function fullScreen(videoNode) {
    if (videoNode.requestFullscreen) {
        videoNode.requestFullscreen();
    } else if (videoNode.mozRequestFullscreen) {
        videoNode.mozRequestFullscreen();
    } else if (videoNode.webkitRequestFullscreen) {
        videoNode.webkitRequestFullscreen();
    }
}
//sessionStorage的动态设置与获取（匿名函数表达式）
let setSessionInfo = (key, value) => sessionStorage.setItem(key, value);
let getSessionInfo = key => sessionStorage.getItem(key);
